Skip to content

Fix shipment state calculation#6321

Merged
jarednorman merged 2 commits intomainfrom
bugfix/shipment-state-calculation
Sep 8, 2025
Merged

Fix shipment state calculation#6321
jarednorman merged 2 commits intomainfrom
bugfix/shipment-state-calculation

Conversation

@adammathys
Copy link
Member

Summary

Adds some missing test coverage to ensure that when all items in a shipment are cancelled, it is correctly marked as cancelled. Unless the shipment has already been shipped, in that case we should maintain the existing state.

Related to #6314 and #6316.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

When cancelling all items in a completed order, if the shipment is not
already shipped, it should be marked as cancelled. However, if the
shipment has already shipped, we should maintain its state because we
treat that state as immutable.
At least, in terms of the state. We shouldn't mark shipped shipments as
cancelled even if all of the items in the shipment get cancelled.

If a shipment has been marked as shipped, then we need to preserve that
state.
@adammathys adammathys self-assigned this Sep 6, 2025
@adammathys adammathys requested a review from a team as a code owner September 6, 2025 02:09
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Sep 6, 2025
@codecov
Copy link

codecov bot commented Sep 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.35%. Comparing base (72f1b5c) to head (593d11a).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6321   +/-   ##
=======================================
  Coverage   89.35%   89.35%           
=======================================
  Files         961      961           
  Lines       20192    20192           
=======================================
  Hits        18043    18043           
  Misses       2149     2149           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tvdeyen tvdeyen added this to the 4.6 milestone Sep 6, 2025
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@jarednorman jarednorman merged commit 6035494 into main Sep 8, 2025
39 checks passed
@jarednorman jarednorman deleted the bugfix/shipment-state-calculation branch September 8, 2025 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:solidus_core Changes to the solidus_core gem

Projects

Development

Successfully merging this pull request may close these issues.

3 participants